package com.cloudy.s3.request;

import com.cloudy.exception.AWSAccessException;
import com.cloudy.impl.SuccessHandlerWithResponse;
import com.cloudy.s3.response.AWSResponse;
import com.cloudy.s3.response.LocationConstraint;

public class GetBucketLocation extends S3Request {

	public GetBucketLocation(String bucketName) {
		super(bucketName, "GET");
		super.successHandler = new SuccessHandlerWithResponse();
		super.subResource = "location";
		attributes.put("location", "");
	}

	public LocationConstraint execute() throws AWSAccessException{
		AWSResponse<LocationConstraint> response =  executeInner();
		return response.getResponse();
	}
}
